package com.ruoyi.yard.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yard.mapper.CompWarehouseInfoMapper;
import com.ruoyi.yard.domain.CompWarehouseInfo;
import com.ruoyi.yard.service.ICompWarehouseInfoService;

/**
 * 构件库存信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-09-02
 */
@Service
public class CompWarehouseInfoServiceImpl implements ICompWarehouseInfoService 
{
    @Autowired
    private CompWarehouseInfoMapper compWarehouseInfoMapper;

    /**
     * 查询构件库存信息
     * 
     * @param id 构件库存信息主键
     * @return 构件库存信息
     */
    @Override
    public CompWarehouseInfo selectCompWarehouseInfoById(Long id)
    {
        return compWarehouseInfoMapper.selectCompWarehouseInfoById(id);
    }

    /**
     * 查询构件库存信息列表
     * 
     * @param compWarehouseInfo 构件库存信息
     * @return 构件库存信息
     */
    @Override
    public List<CompWarehouseInfo> selectCompWarehouseInfoList(CompWarehouseInfo compWarehouseInfo)
    {
        return compWarehouseInfoMapper.selectCompWarehouseInfoList(compWarehouseInfo);
    }

    /**
     * 新增构件库存信息
     * 
     * @param compWarehouseInfo 构件库存信息
     * @return 结果
     */
    @Override
    public int insertCompWarehouseInfo(CompWarehouseInfo compWarehouseInfo)
    {
        compWarehouseInfo.setCreateTime(DateUtils.getNowDate());
        return compWarehouseInfoMapper.insertCompWarehouseInfo(compWarehouseInfo);
    }

    /**
     * 修改构件库存信息
     * 
     * @param compWarehouseInfo 构件库存信息
     * @return 结果
     */
    @Override
    public int updateCompWarehouseInfo(CompWarehouseInfo compWarehouseInfo)
    {
        compWarehouseInfo.setUpdateTime(DateUtils.getNowDate());
        return compWarehouseInfoMapper.updateCompWarehouseInfo(compWarehouseInfo);
    }

    /**
     * 批量删除构件库存信息
     * 
     * @param ids 需要删除的构件库存信息主键
     * @return 结果
     */
    @Override
    public int deleteCompWarehouseInfoByIds(Long[] ids)
    {
        return compWarehouseInfoMapper.deleteCompWarehouseInfoByIds(ids);
    }

    /**
     * 删除构件库存信息信息
     * 
     * @param id 构件库存信息主键
     * @return 结果
     */
    @Override
    public int deleteCompWarehouseInfoById(Long id)
    {
        return compWarehouseInfoMapper.deleteCompWarehouseInfoById(id);
    }
}
